<!DOCTYPE html>
<html>
<head>
<title>无标题文档</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
<meta name="keywords" content="龙泉旅游网">
<meta name="description" content="龙泉旅游网">
<!-- Bootstrap -->
<link href="__PUBLIC__/css/bootstrap.min.css" rel="stylesheet">
<link href="__PUBLIC__/css/style.css" rel="stylesheet">
<script src="__PUBLIC__/js/jquery-2.0.2.min.js"></script>
<script src="__PUBLIC__/js/bootstrap.min.js"></script>

<!--[if lt IE 9]>
<script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="http://scottjehl.github.io/Respond/dest/respond.src.js"></script>
<![endif]-->

</head>

<body>


<header>
    <nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0px;">
      <!-- We use the fluid option here to avoid overriding the fixed width of a normal container within the narrow content columns. -->
      <div class="container-fluid">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-8">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          
          <a href="#" class="navbar-brand pull-right" id="loginout">退出</a>
          
          <a class="navbar-brand" href="#"><span class="glyphicon glyphicon-home"></span> 丽水旅游网</a>
        </div>

        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-8">
          
        </div>
      </div>
    </nav>
</header>

<section class="mybg">

<div class="jumbotron mybg color_w" style="margin-bottom:0;">
  <h4>2014古堰画乡"缤纷之夜" ---暨夏季夜游活动:</h4>
    <p style="font-size:14px;">夜幕下的古堰画乡，灯火辉煌。画乡老街大红灯笼高高挂，千年老樟树在灯光的照耀下演绎着别样的故事与精彩，湖面上的灯船更为古镇平添几分夜的神韵，人群熙嚷，仰望天空，繁星点点，不知是天上人间，在这炎热的夏天，来到古堰画乡，享受夏日的清凉快感！</p>
</div>
</section>




<br>

<div class="container">
	
    <br>
    <div class="row">
    	<div class="col-xs-12">
        
        	<div class="panel panel-default">
              <div class="panel-heading">已报名人数: <strong>{$count}</strong>人</div>
              <div class="panel-body">
                <div class="table-responsive" style="background:#fff">  
                <table class="table table-bordered">
                	<thead>
                    <tr>
                    <td>编号</td>
                    <td>姓名</td>
                    <td>票数</td>
                    <td width="10%">状态</td>
                    <td width="10%">操作</td>
                    </tr>
                    </thead>
                    <tbody>
                        <volist name="list" id="data">                        
                        <tr>
                        <td>{$i}</td>
                        <td>{$data.name}</td>
                        <td>{$data.number}张</td>
                        <td>
                        <if condition="$data.state eq 1 ">
                        <button value="{$data.id}" class="btn btn-success btn-xs" name="edit"><i class="glyphicon glyphicon-edit"></i> 已通过</button>                        
                        <else />
                        <button value="{$data.id}" name="edit" class="btn btn-danger btn-xs"><i class="glyphicon glyphicon-edit"></i> 未通过</button>                        
                        </if>
                        </td>
                        <td>
                        <button value="{$data.id}" name="delete" class="btn btn-warning btn-xs"><i class="glyphicon glyphicon-trash"></i> 删除</button>
                        </td>
                        </tr>
                        </volist>
                    </tbody>
                </table>
            </div>
              </div>
            </div>
        
        
        
        
            
    	</div>
    </div>

</div>


<script type="text/javascript">
	$(document).ready(function(e) {
		//修改状态
        $("button[name='edit']").click(function(){			
			var id=$(this).val();
			var my=$(this);
			$.post("{:U('state_edit')}", {id:id}, function(data){				
				if(data.state=='1'){
					my.attr("class","btn btn-success btn-xs");	
					my.html("<i class=\"glyphicon glyphicon-edit\"></i> 已通过")	;			
				}else{
					my.attr("class","btn btn-danger btn-xs");
					my.html("<i class=\"glyphicon glyphicon-edit\"></i> 未通过")	;
				}				
				});
				return false;
			
			});
			
			
			
		//删除
		$("button[name='delete']").click(function(){	
			var id=$(this).val();
			var my=$(this);
			if(!confirm("是否确认删除")) return false;
			$.post("{:U('delete')}", {id:id}, function(data){				
				if(data){					
					my.parents('tr').hide("show");					
					}
				});
		});
		
		
		$("#loginout").click(function(){
			
			if(confirm("确认退出")){
			$.post("{:U('login/loginout')}", {id:'2'}, function(data){				
				if(data.status==1){
					alert(data.info);
					location.href="{:U('"+data.url+"')}";
				}
				});
				};		
			});
		
    });
</script>




</body>
</html>
